/* Global styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Set special font for non-tool call content */
.rendered-content, .preview-text, .browser-agent-content {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Keep MCP tool calls using original font */
.mcp-tool-call {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Ensure MCP tool call content uses original font */
.mcp-tool-call * {
    font-family: inherit;
}

/* Navigation button styles */
.nav-btn {
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* File selection input group styles */
.file-navigation {
    display: flex;
    align-items: center;
    gap: 0;
}

.file-navigation .form-select {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

.file-navigation .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.file-navigation .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Card styles */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    border-radius: 8px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
}

/* Top summary panel styles */
.summary-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.summary-panel h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.summary-panel .answer-box {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-panel .answer-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 0;
    white-space: nowrap;
}

.summary-panel .answer-content {
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.summary-panel .final-answer {
    border-left: 4px solid #007bff;
}

.summary-panel .ground-truth {
    border-left: 4px solid #28a745;
}

.summary-panel .stat-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-panel .stat-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.summary-panel .stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

/* Navigation panel styles */
.navigation-panel {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.navigation-list {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.nav-item {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.nav-item:hover {
    /* Remove background color change, can add other subtle visual feedback */
}

.nav-item.active {
    background-color: #007bff;
    color: white;
}

.nav-item .step-number {
    font-weight: bold;
    color: #6c757d;
}

.nav-item.active .step-number {
    color: white;
}

.nav-item .step-role {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.nav-item .step-role.user {
    background-color: #28a745;
    color: white;
}

.nav-item .step-role.assistant {
    background-color: #007bff;
    color: white;
}

.nav-item .step-role.tool {
    background-color: #fd7e14;
    color: white;
}

.nav-item .step-role.system {
    background-color: #6c757d;
    color: white;
}

.nav-item .step-summary {
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-item.active .step-summary {
    color: #e9ecef;
}

/* Browser sub-step navigation styles */
.nav-item.browser-sub-step {
    padding-left: 24px;
    font-size: 12px;
    border-left: 2px solid #dee2e6;
    margin-left: 8px;
}

.nav-item.browser-sub-step .step-number {
    font-size: 11px;
    color: #6c757d;
}

.nav-item.browser-sub-step .step-role {
    font-size: 10px;
    padding: 1px 4px;
}

.nav-item.browser-sub-step .step-summary {
    font-size: 11px;
    -webkit-line-clamp: 1;
}

.nav-item.browser-sub-step.active {
    border-left-color: #007bff;
}

.nav-item .browser-toggle {
    margin-left: auto;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    padding: 2px 4px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.nav-item .browser-toggle:hover {
    background-color: #e9ecef;
}

.nav-item.active .browser-toggle {
    color: #fff;
}

.nav-item.active .browser-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.browser-sub-steps {
    display: none;
}

.browser-sub-steps.expanded {
    display: block;
}

/* Execution flow styles */
.execution-steps-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.execution-step {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0;  /* Remove bottom margin, use gap instead */
    background-color: white;
    transition: all 0.3s ease;
    position: relative;
}

.execution-step:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Ensure main agent steps have clear visual separation */
.execution-step[data-agent*="main_agent"] {
    border-left: 4px solid #007bff;
    z-index: 2;
}

/* Browser session should be indented inside main agent steps */
.browser-session {
    position: relative;
    margin-left: 20px;
    margin-top: 12px;
}

.step-header {
    padding: 12px 16px;
    cursor: pointer;
    position: relative;
    border-radius: 6px 6px 0 0;
}

.step-header:hover {
    background-color: #f8f9fa;
}

.step-header.user-message {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.step-header.assistant-message {
    background-color: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.step-header.user-message.browser-agent {
    background-color: #e8f5e8;
    border-left: 4px solid #4caf50;
}

.step-header.assistant-message.browser-agent {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
}

.step-header.tool-message {
    background-color: #fff3e0;
    border-left: 4px solid #fd7e14;
}

.step-header.system-message {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.step-content {
    padding: 16px;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.step-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #6c757d;
}

/* Tool call styles */
.tool-call {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px;
    margin: 8px 0;
}

.tool-call-header {
    font-weight: 500;
    color: #856404;
    margin-bottom: 5px;
}

.tool-call.browser-agent {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.tool-call.browser-agent .tool-call-header {
    color: #155724;
}

/* Browser session styles */
.browser-session {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
    padding: 12px;
}

.browser-session-header {
    font-weight: 500;
    color: #495057;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.browser-step {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
    padding: 8px 12px;
}

.browser-step.user {
    background-color: #f0f8ff;
}

.browser-step.assistant {
    background-color: #fdf6e3;
}

.browser-step.tool {
    background-color: #fff3e0;
    border-left: 3px solid #fd7e14;
}

.browser-step.system {
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
}

/* Statistics styles */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 500;
    color: #495057;
}

.stat-value {
    font-weight: 600;
    color: #007bff;
}

/* Badge styles */
.badge-role {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-user {
    background-color: #007bff;
    color: white;
}

.badge-assistant {
    background-color: #6f42c1;
    color: white;
}

.badge-tool {
    background-color: #fd7e14;
    color: white;
}

.badge-system {
    background-color: #6c757d;
    color: white;
}

.badge-browser {
    background-color: #28a745;
    color: white;
}

/* Timestamp styles */
.timestamp {
    font-size: 11px;
    color: #6c757d;
    font-family: monospace;
}

/* Content preview styles */
.content-preview {
    background-color: white;
    border-radius: 4px;
    padding: 8px;
    margin: 8px 0;
}

.content-preview .preview-text {
    line-height: 1.5;
}

.expand-preview-btn {
    color: #007bff !important;
    font-size: 12px;
    text-decoration: none;
}

.expand-preview-btn:hover {
    text-decoration: underline !important;
}

/* Step content area style adjustments */
.step-content {
    padding: 16px;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.step-content h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Button styles */
.btn-sm {
    font-size: 12px;
    padding: 4px 12px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 10px;
    }
    
    .col-md-3 {
        order: 2;
    }
    
    .col-md-9 {
        order: 1;
    }
    
    .step-header {
        padding: 10px 12px;
    }
    
    .step-content {
        padding: 12px;
    }
}

/* Animation effects */
.collapse {
    transition: height 0.3s ease;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tooltip styles */
.tooltip {
    font-size: 12px;
}

/* Code styles */
.code-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    margin: 8px 0;
    overflow-x: auto;
    line-height: 1.4;
}

.code-block pre {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    white-space: pre-wrap;
}

.code-block code {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Error styles */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    color: #28a745;
    font-size: 14px;
    margin-top: 8px;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* MCP tool call styles */
.mcp-tool-call {
    background-color: #ffffff;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
    overflow: hidden;
}

.mcp-tool-call.browser-agent {
    border-color: #28a745;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(40,167,69,0.1);
}

.mcp-tool-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 12px;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.mcp-tool-call.browser-agent .mcp-tool-header {
    color: #28a745;
}

.mcp-tool-header i {
    margin-right: 8px;
    font-size: 16px;
}

.mcp-tool-name {
    font-family: 'Courier New', monospace;
    background-color: rgba(0,123,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 4px;
    font-size: 13px;
}

.mcp-tool-call.browser-agent .mcp-tool-name {
    background-color: rgba(40,167,69,0.1);
}

.mcp-tool-content {
    margin-top: 8px;
}

.mcp-xml-structure {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    line-height: 1.6;
    font-size: 13px;
}

.xml-tag {
    color: #0066cc;
    font-weight: 500;
    margin: 2px 0;
}

.xml-content {
    margin-left: 20px;
    margin: 8px 0 8px 20px;
}

.xml-arguments {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0 8px 20px;
    white-space: pre-wrap;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
}

.mcp-tool-args {
    margin-top: 8px;
}

.mcp-args-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
    font-size: 13px;
}

/* Format badge styles */
.badge-format {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: normal;
}

.badge-format {
    background-color: #6c757d;
    color: white;
}

/* Format badge default styles, can be extended as needed */

/* Tool ID styles */
.tool-id {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

/* Rendered content styles - white background */
.rendered-content {
    background-color: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    margin: 8px 0;
    line-height: 1.6;
}

.rendered-content h1 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 16px;
    font-size: 1.5em;
}

.rendered-content h2 {
    color: #34495e;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 6px;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.rendered-content h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.rendered-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.rendered-content em {
    color: #7f8c8d;
    font-style: italic;
}

.rendered-content ul, .rendered-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.rendered-content li {
    margin: 4px 0;
}

.rendered-content a {
    color: #3498db;
    text-decoration: none;
}

.rendered-content a:hover {
    text-decoration: underline;
}

.rendered-content .inline-code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.rendered-content .code-block {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin: 8px 0;
    overflow-x: auto;
}

.rendered-content .code-block pre {
    margin: 0;
    padding: 12px;
    background: none;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    color: #2c3e50;
}

.rendered-content .code-block code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: inherit;
}

/* Improve browser agent content styles */
.browser-agent-content {
    background-color: #f8fff8;
    border: 1px solid #d4edda;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0;
}

/* Improve content display in modal */
.modal-body .rendered-content {
    max-height: 400px;
    overflow-y: auto;
} 